package com.yowasa.xiuxian.engine.battle.enemy.strategy;

import com.google.common.collect.Lists;
import com.yowasa.xiuxian.annoations.BS;
import com.yowasa.xiuxian.constant.XiuxianConstants;
import com.yowasa.xiuxian.engine.battle.strategy.BaseSpellStrategy;
import com.yowasa.xiuxian.entity.bo.battle.BattleContent;
import com.yowasa.xiuxian.entity.bo.battle.UserBattleContent;
import com.yowasa.xiuxian.entity.bo.user.UserBO;
import com.yowasa.xiuxian.entity.enums.ElementEnum;
import com.yowasa.xiuxian.exception.HandlerException;
import com.yowasa.xiuxian.service.helper.BattleHelper;
import com.yowasa.xiuxian.util.RandomUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

@BS(name = "兽境之狼")
@Order(1006)
@Component
public class ShouJingZhiLang extends BaseSpellStrategy {
    @Autowired
    private BattleHelper battleHelper;

    @Override
    public ElementEnum getElement() {
        return null;
    }

    @Override
    public void action(UserBattleContent first, UserBattleContent second, BattleContent content) {
        int dmg;
        String desc;

        int orgAtk = first.getBattleInfo().getSpell() + first.getBattleInfo().getAtk();
        int def = (int) ((second.getBattleInfo().getRes() + second.getBattleInfo().getDef()) * 0.4);
        int atk = (int) (orgAtk * 1.3);
        desc = RandomUtil.choice(Lists.newArrayList("炼金伤痕","嗜魔","破空撕裂","虚无掩袭"));
        dmg = battleHelper.calAtk(atk, def);
        battleHelper.autoAction(this, first, second, content, dmg, desc);
    }

    @Override
    public void limit(UserBO user) {
        throw new HandlerException("无法学习妖兽的攻击手段");
    }

    @Override
    public String limitDesc() {
        return "无";
    }

    @Override
    public String desc() {
        return  "能够侵蚀世界边界的魔血之兽。「黄金」将其命名为「淋溶」。\n" +
                "有伴随渊薮的渗透，吞噬元素的习性。值得庆幸的是这些魔兽如今数量并不多。\n\n" +
                "攻击能无视一定防御,技能组\n"+
                "炼金伤痕，嗜魔，破空撕裂，虚无掩袭";
    }


}
